<?php
namespace App\Admin\Server;
use App\Models\Integral;
use Dcat\Admin\Support\LazyRenderable;
use Dcat\Admin\Widgets\Table;

class AdminRender extends LazyRenderable
{
    public function render()
    {
        // 获取ID
        $id = $this->id;
        $ordergoods=new Integral();
        $data = $ordergoods->where('user_id', $id)
            ->join('userInfo','integral.user_id','userInfo.id')
            ->get()
            ->toArray();

        foreach ($data as $k=> $v){

            $datas[$k]['nickName']=$v['nickName'];
            $datas[$k]['tel']=$v['tel'];
        }
        $titles = [
            '商品名称',
            '商品单价',
        ];
        return Table::make($titles, $datas);
    }
}
